<?
$rightCol  = 1;
$eventMenu = 0;
include('includes/appInit.php');
include('includes/header.php');
$library = new Library();

if (!empty($_GET['cat'])) {	 
	$library->getLibraryItemsByCategory($_GET['cat']);	
	$breadcrumbs = $library->makeBreadcrumbs('category',$_GET['cat']);
} elseif (!empty($_GET['item'])) {
	$library->getLibraryItem($_GET['item']);	
} elseif (!empty($_GET['tag'])) {
	$library->getLibraryItemsByTag($_GET['tag']);
	$breadcrumbs = $library->makeBreadcrumbs('tag',$_GET['tag']);
} elseif (!empty($_GET['viewBy'])) {
	if ($_GET['viewBy'] == 'category') {	
		$library->getLibraryCategories(10);
		$breadcrumbs = $translate->_('View items by category');	
	} elseif ($_GET['viewBy'] == 'tag') {
		$library->getLibraryTags();	
		$breadcrumbs = $translate->_('View items by tag name');	
	}
} else {
	$library->getLibraryCategories();
}
?>
	<div id="subPage">
		<div class="leftCol">
		
			<div id="subPageContent" class="flex">
				<h1><?=$translate->_('View library items'); ?></h1>
				<div class="hiLite" style="padding-top: 5px;">
					<h2 style="float: left; width: 75%; margin: 5px;"><?=$breadcrumbs; ?></h2>
					<div style="float: left; width: 10%;">
						<p><div class="buttonSearchLink"><a href="librarySearch.php" title="<?=$translate->_('Search the library'); ?>" style="padding-top: 10px;"><?=$translate->_('Search'); ?></a></div></p>
					</div>
					<div style="clear: left;"></div>
				</div>	
				
				<p style="margin-top: 10px;">
					<? echo $library->renderLibraryHTML(); ?>
				</p>
				
			</div>
		</div>
		<div class="rightCol noPrint">
			<div class="rightColInner flex" style="height: 500px;">
				<? include('includes/rightColumn.php'); ?>
			</div>
		</div>
		<div style="clear: both;"></div>
	</div>	
	
	
<?
include('includes/footer.php');
?>